<include file="Public/header" />
<script type="text/javascript">
function submit_delete_batch(){
    /* 获取选中的项 */
    var items = '';
    $('.checkitem:checked').each(function(){
        items += this.value + ',';
    });
    if(items != '') {
        items = items.substr(0, (items.length - 1));
        submit_delete(items);
    }  
    else {
        alert('<?php echo $lang['nc_please_select_item'];?>');
    }
}

function submit_delete(id){
    if(confirm('<?php echo $lang['nc_admin_coupon_download_del'];?>')) {
        $('#list_form').attr('method','post');
        $('#list_form').attr('action','index.php?act=coupon&op=downloaddel');
   		    
        $('#coupon_id').val(id);
        $('#list_form').submit();
    }
}

</script>
<div class="page">
  <div class="fixed-bar">
    <div class="item-title">
      <h3>优惠券下载</h3>
      <ul class="tab-base">
        <li><a href="javascript:void(0);" class="current"><span>管理</span></a></li>
      </ul>
    </div>
  </div>
  <div class="fixed-empty"></div>
  <form method="get" name="formSearch">
    <table class="tb-type1 noborder search">
      <tbody>
        <tr>
          <th>优惠券名称</th>
          <td><input type="text" value="{$search['coupon_name']}" name="coupon_name" class="txt" ></td>
          <td><a href="javascript:document.formSearch.submit();" class="btn-search tooltip" title="查询">&nbsp;</a></td>
        </tr>
      </tbody>
    </table>
  </form>
  <!-- 操作说明 -->
  <table class="table tb-type2" id="prompt">
    <tbody>
      <tr class="space odd">
        <th colspan="12" class="nobg">
        	<div class="title">
	            <h5>操作提示</h5>
	            <span class="arrow"></span>
            </div>
        </th>
      </tr>
      <tr>
        <td>
        	<ul>
         	   <li>列表显示会员名称、优惠券名称、下载时间等信息</li>
          	</ul>
         </td>
      </tr>
    </tbody>
  </table>
  <form id="list_form" method='post'>
    <input id="coupon_id" name="coupon_id" type="hidden"/>
    <table class="table tb-type2">
      <thead>
        <tr class="space">
          <th colspan="15" class="nobg">列表</th>
        </tr>
        <tr class="thead">
          <th>会员名称</th>
		  <th>优惠券名称</th>
		  <th>下载时间</th>
		  <th>下载方式</th>
        </tr>
      </thead>
      <tbody>
        <notempty name="list">
        <volist name="list" id="val">
        <tr class="hover edit">
          <td>{$val['member_name']}</td>
		  <td><a href="" target="_blank">{$val['coupon_name']}</a></td>
		  <td>{$val['download_time']|date='Y-m-d:H:i:s',###}</td>
		  <td>{$val['download_type']==1?'打印':'短信'}</td>
        </tr>
        </volist>
        <else/>
        <tr class="no_data">
          <td colspan="10">暂无记录</td>
        </tr>
        </notempty>
      </tbody>
      <notempty name="list">
      <tfoot>
        <tr class="tfoot">
          <td id="batchAction" colspan="15">
            <div class="pagination">{$page_show}</div>
        </tr>
      </tfoot>
      </notempty>
    </table>
  </form>
</div>
<include file="Public/footer" />